/**
 * 
 */
package jmine.tec.test.entities.domain;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import jmine.tec.persist.annotation.Alias;
import jmine.tec.persist.annotation.Comment;
import jmine.tec.persist.annotation.Comments;
import jmine.tec.persist.annotation.Index;
import jmine.tec.persist.annotation.Indexes;
import jmine.tec.persist.annotation.UniqueConstraint;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.ForeignKey;

import bancosys.tec.component.Documentation;
import bancosys.tec.persist.bussobj.PersistableBusinessObject;

/**
 * @author piercio
 */
@Entity
@Table(name = "SD_VALOR")
@Alias("SDV")
@SequenceGenerator(name = "SEQ_SD_VALOR", sequenceName = "SEQ_SD_VALOR")
@Documentation("TABELA DE TESTES.")
public class SerieDv extends PersistableBusinessObject {

    private List<DataValor> pontos;

    private Long id;

    /**
     * {@inheritDoc}
     */
    @Id
    @Column(name = "ID")
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_SD_VALOR")
    @Documentation("TABELA DE TESTES.")
    public Long getId() {
        return this.id;
    }

    /**
     * {@inheritDoc}
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @return o valor do campo pontos.
     */
    @Indexes({ @Index(suffix = "JT_0", columns = "COD_SERIE_DV"), @Index(suffix = "JT_1", columns = "COD_DATA_VALOR") })
    @OneToMany
    @Comments({ @Comment(table = "SERIE_DV_DATA_VALOR", value = "TABELA DE TESTES"),
            @Comment(table = "SERIE_DV_DATA_VALOR", column = "COD_SERIE_DV", value = "TESTE"),
            @Comment(table = "SERIE_DV_DATA_VALOR", column = "COD_DATA_VALOR", value = "TESTE") })
    @JoinTable(name = "SERIE_DV_DATA_VALOR", joinColumns = @JoinColumn(name = "COD_SERIE_DV"), inverseJoinColumns = @JoinColumn(name = "COD_DATA_VALOR"))
    @Alias("SDDV")
    @ForeignKey(name = "FK_SDV_SDDV", inverseName = "FK_DTVAL_SDDV")
    @Cascade({ CascadeType.ALL, CascadeType.DELETE_ORPHAN })
    @UniqueConstraint(suffix = "0", columns = "COD_DATA_VALOR")
    public List<DataValor> getPontos() {
        return this.pontos;
    }

    /**
     * Define o valor do campo pontos.
     * 
     * @param pontos o valor para o campo pontos.
     */
    public void setPontos(List<DataValor> pontos) {
        this.pontos = pontos;
    }

}
